<?php
/**
 *
 * @author dinglin
 * QA系统相关配置
 */
class Const_Qa {
    /**
     * 财务
     */
    const TAG_FINANCE = 1;
    const TAG_FINANCE_BIAODAN = 1;//表单
    const TAG_FINANCE_BAOXIAO = 2;//报销/付款
    const TAG_FINANCE_FAPIAO  = 3;//发票
    const TAG_FINANCE_HETONG  = 4;//合同
    const TAG_FINANCE_LIUCHENG  = 5;//操作流程
    const TAG_FINANCE_KAIPIAO  = 6;//公司开票信息
    const TAG_FINANCE_ZHIDU  = 7;//参考制度
    const TAG_FINANCE_LIANXI  = 8;//联系我们
    const TAG_FINANCE_CHANGSHI  = 9;//财务常识
    /**
     * 根据code获取标题栏 为空时返回所有
     */
    public static function get_menu_list_zh($code=0){
        $list = array(
                'finance'=>'财务',
                );
        if(empty($code)){
            return $list;
        }
        return $list[$code];
    }
    /**
     * 根据code获取对应的url中使用的name 为空时返回所有
     */
    public static function get_menu_list_en($code=0){
        $list = array(
                self::TAG_FINANCE=>'finance',
                );
        if(empty($code)){
            return $list;
        }
        return $list[$code];
    }
    /**
     * 获取管理员
     */
    public static function get_managers( $tag = self::TAG_FINANCE){
        $managers = APF::get_instance()->get_config('qa_manager_list');
        return $managers[$tag];
    }
    /**
     * 获取左边ID
     */
    public static function get_left_list_id( $tag = self::TAG_FINANCE){
        $left_list = array(
                self::TAG_FINANCE=>array(
                        self::TAG_FINANCE_BIAODAN=>array(
                                'name'=>'表单下载',
                                'html_name'=>'表单下载'
                                ),
                        self::TAG_FINANCE_BAOXIAO=>array(
                                'name'=>'报销/付款',
                                'html_name'=>'报销/付款'
                                ),
                        self::TAG_FINANCE_FAPIAO=>array(
                                'name'=>'发票',
                                'html_name'=>'发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;票'
                                ),
                        self::TAG_FINANCE_HETONG=>array(
                                'name'=>'合同',
                                'html_name'=>'合&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同'
                                ),
                        self::TAG_FINANCE_LIUCHENG=>array(
                                'name'=>'操作流程',
                                'html_name'=>'操作流程'
                                ),
                        self::TAG_FINANCE_KAIPIAO=>array(
                                'name'=>'开票信息',
                                'html_name'=>'开票信息'
                                ),
                        self::TAG_FINANCE_ZHIDU=>array(
                                'name'=>'参考制度',
                                'html_name'=>'参考制度'
                                ),
                        self::TAG_FINANCE_LIANXI=>array(
                                'name'=>'联系我们',
                                'html_name'=>'联系我们'
                                ),
                        self::TAG_FINANCE_CHANGSHI=>array(
                                'name'=>'财务常识',
                                'html_name'=>'财务常识'
                                ),

                )
        );
        return $left_list[$tag];
    }
    /**
     * 根据参数获取左边名称
     * @param unknown_type $cate
     * @param unknown_type $type
     */
    public function get_left_name_by_id($cate,$type = self::TAG_FINANCE){
        $list = self::get_left_list_id($type);
        if(empty($list[$cate])){
            return 0;
        }
        return $list[$cate]['name'];
    }
}